#include"other.h"

osg::Camera* createHUDCamera( double left, double right, double bottom, double top )
{
  osg::ref_ptr<osg::Camera> camera = new osg::Camera;
  camera->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
  //camera->setClearMask( GL_DEPTH_BUFFER_BIT );
	camera->setClearMask(NULL);
  camera->setRenderOrder( osg::Camera::POST_RENDER );
  camera->setAllowEventFocus( false ); 
  camera->setProjectionMatrix( osg::Matrix::ortho2D(left, right, bottom, top) );
  return camera.release();
}

osgText::Text* createText( const osg::Vec3& pos, wchar_t content[], float size,
	const osg::Vec4& color, osgText::Font* font, ... )
{
  osg::ref_ptr<osgText::Text> text = new osgText::Text;
  text->setFont( font );
  text->setCharacterSize( size );
  text->setAxisAlignment( osgText::TextBase::XY_PLANE );
  text->setPosition( pos );
  text->setText( content );
	text->setColor( color );
  return text.release();
}

osgText::Text* createText( const osg::Vec3& pos, string content, float size,
	const osg::Vec4& color, osgText::Font* font, ... )
{
  osg::ref_ptr<osgText::Text> text = new osgText::Text;
  text->setFont( font );
  text->setCharacterSize( size );
  text->setAxisAlignment( osgText::TextBase::XY_PLANE );
  text->setPosition( pos );
  text->setText( content );
	text->setColor( color );
  return text.release();
}